package com.runen.infinitemovement.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Create by LiaoDuanHong
 * Create on 2020/09/21 16:23
 */
public class RouteEntity implements Parcelable {

    /**
     * cover :
     * isChallenge : true
     * name :
     * pathId :
     */

    public String cover;
    public boolean challenge;
    public String pathName;
    public long pathId;
    public String imageUrl;

    protected RouteEntity(Parcel in) {
        cover = in.readString();
        challenge = in.readByte() != 0;
        pathName = in.readString();
        pathId = in.readLong();
    }

    public static final Creator<RouteEntity> CREATOR = new Creator<RouteEntity>() {
        @Override
        public RouteEntity createFromParcel(Parcel in) {
            return new RouteEntity(in);
        }

        @Override
        public RouteEntity[] newArray(int size) {
            return new RouteEntity[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(cover);
        dest.writeByte((byte) (challenge ? 1 : 0));
        dest.writeString(pathName);
        dest.writeLong(pathId);
    }
}
